package com.ybt.communicate.ws.configration;

import java.util.ArrayList;
import java.util.List;

public class WSRuntimeConfig {
    private WSProtocolConfig staticConfig;
    private String target;
    private String targetNamespace;
    private String mode;
    private String method;
    private long readTimeout;
    private long connTimeout;
    private String action;
    private List<Parameter> parameters;
    private boolean duplex;

    public WSRuntimeConfig(WSProtocolConfig staticConfig) {
        super();
        this.staticConfig = staticConfig;
        this.parameters = new ArrayList<Parameter>();
    }
    public WSProtocolConfig getStaticConfig() {
        return staticConfig;
    }
    public void setStaticConfig(WSProtocolConfig staticConfig) {
        this.staticConfig = staticConfig;
    }
    
    public String getProtocolMode() {
        // TODO Auto-generated method stub
        return staticConfig.getProtocolMode();
    }

    public String getIODirection() {
        return staticConfig.getIODirection();
    }

    public boolean isServerSide() {
        return staticConfig.isServerSide();
    }
    
    public long getReadTimeout() {
        return readTimeout;
    }
    public long getConnTimeout() {
        return connTimeout;
    }
    
    public String getProtocolType() {
        return staticConfig.getProtocolType();
    }

    public String getProtocolId() {
        return staticConfig.getProtocolId();
    }

    public boolean isDuplex() {
        // TODO Auto-generated method stub
        return duplex;
    }
    public void setDuplex(boolean duplex) {
        // TODO Auto-generated method stub
        this.duplex = duplex;
    }
    public String getTarget() {
        return target;
    }
    public void setTarget(String target) {
        this.target = target;
    }
    public String getTargetNamespace() {
        return targetNamespace;
    }
    public void setTargetNamespace(String targetNamespace) {
        this.targetNamespace = targetNamespace;
    }
    public String getMode() {
        return mode;
    }
    public void setMode(String mode) {
        this.mode = mode;
    }
    public String getMethod() {
        return method;
    }
    public void setMethod(String method) {
        this.method = method;
    }
    public String getAction() {
        return action;
    }
    public void setAction(String action) {
        this.action = action;
    }
    public List<Parameter> getParameters() {
        return parameters;
    }
    public void setParameters(List<Parameter> parameters) {
        this.parameters = parameters;
    }

    public void addParameter(String type, String value) {
        this.parameters.add( this.new Parameter(type,value));
    }
    
    public class Parameter{
        String type;
        String value;
        
        public Parameter(String type, String value) {
            super();
            this.type = type;
            this.value = value;
        }
        public String getType() {
            return type;
        }
        public void setType(String type) {
            this.type = type;
        }
        public String getValue() {
            return value;
        }
        public void setValue(String value) {
            this.value = value;
        }
        
        
    }
    
    
}
